#ifndef _FIG_BULLET_H_
#define _FIG_BULLET_H_

#include "ui/ui_manager.h"
#include "math/movement.h"


class FIGLifeObj;

class FIGBullet
{
public:

	enum BULLET_TYPES
	{
		BULLET_TYPE_PLAYER_BLUE,
		BULLET_TYPE_PLAYER_RED,
		BULLET_TYPE_PLAYER_GREEN,
		BULLET_TYPE_PLAYER_ROCKET,
		BULLET_TYPE_PLAYER_TOPIDO,

		BULLET_TYPE_ENEMY_START,
		BULLET_TYPE_ENEMY_CIRCLE_ROTATE,
		BULLET_TYPE_ENEMY_CIRCLE_GLOW,
		BULLET_TYPE_ENEMY_CIRCLE_DOUBLELAYER,
		BULLET_TYPE_ENEMY_CIRCLE_TRIPPLELAYER,		

		BULLET_TYPE_ENEMY_LONG_GREEN,
		BULLET_TYPE_ENEMY_LONG_RED,
		BULLET_TYPE_ENEMY_LONG_YELLOW,
		BULLET_TYPE_ENEMY_LONG_CYAN,

		BULLET_TYPE_EFFECT_FIRE,
		BULLET_TYPES_ENEMY_ROCKET,

		BULLET_TYPE_C,

	};

	enum STARTPOS
	{
		STARTPOS_LEFT,
		STARTPOS_RIGHT,
		STARTPOS_MIDDLE
	};

	enum SHOOT_STYLES
	{
		SHOOT_STYLES_SINGLE,
		SHOOT_STYLES_DOUBLE,
		SHOOT_STYLES_TRIPPLE,
		SHOOT_STYLES_TRIPPLE_STRAIGHT,
		SHOOT_STYLES_RAMBO_4,
		SHOOT_STYLES_RAMBO_5,
		SHOOT_STYLES_RAMBO_6,
		SHOOT_STYLES_ROCKET2,
		SHOOT_STYLES_ROCKET4,
		SHOOT_STYLES_ROCKET6,

		SHOOT_STYLES_SHAPE_TRIANGLE,
		SHOOT_STYLES_SHAPE_CIRCLE,

		SHOOT_STYLES_COUNT

	};


	

	FIGBullet(	float Speed, 
				bool Rotate,
				float DamagePower,
				BULLET_TYPES Type
				);
	

	virtual void					Render(const math::Vec2& Offset,float Scale);
	virtual void					RenderDebug(const math::Vec2& Offset,float Scale);
	virtual void					Tick(float dt);
	virtual void					ReSpawn(const math::Vec2& Pos,
											FIGBullet::STARTPOS StartDir,
											const math::Vec2& TargetDir
											);


	virtual void					Clear();
	virtual	void					Kill();
	virtual bool					IsOwnHitTest() const { return false; };
	virtual bool					OwnHitTest(FIGLifeObj* pObj){ return false; };

	static std::string				GetSpriteNameByType(FIGBullet::BULLET_TYPES Type);


	void							Load(const std::string& Name);
	


	bool							IsAlive()const { return m_IsAlive; };
	const math::Vec2&				GetPos() const { return m_Pos; };
	float							GetHowlong() const  { return m_Howlong; };
	math::Vec2						GetDirection() const { return m_Dir; };

	float							GetRadius() const { return m_Radius; };	
	ui::UISprite*					GetSprite()  { return &m_Sprite; };
	void							SetDelay(float Delay) { m_Delay = Delay; };
	float							GetDamagePower() const;
	BULLET_TYPES					GetType() const { return m_Type; };


protected:

	float							m_Speed;
	
	math::Vec2						m_Pos;
	float							m_Howlong;

	ui::UISprite					m_Sprite;
	bool							m_IsAlive;

	float							m_Radius;
	math::Vec2						m_Dir;
	bool							m_bRotate;
	float							m_Rotation;
	float							m_Delay;
	float							m_DamagePower;
	BULLET_TYPES					m_Type;
	math::Movement					m_Movement;

};

#endif